package com.lagou.rpc.consumer;

import com.lagou.rpc.consumer.balancer.ZkLoadBalancer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;

@ComponentScan(basePackages = "com.lagou.*")
@SpringBootApplication
public class ClientBootstrapApplication implements CommandLineRunner {

    @Autowired
    ZkLoadBalancer zookeeperService;

    public static void main(String[] args) {
        SpringApplication.run(ClientBootstrapApplication.class, args);
    }


    @Override
    public void run(String... args) throws Exception {
        zookeeperService.start();
    }
}
